﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Custom="http://schemas.awesomium.com/winfx" x:Class="browser4gp.Views.BrowserView"
        xmlns:dc="clr-namespace:wpf4gp.Dependencies;assembly=wpf4gp"
        dc:DialogCloser.DialogResult="{Binding DialogResult}"
        WindowStartupLocation="CenterScreen"
        WindowState="{Binding Path=WindowStyle.WindowState}" 
        Height="{Binding Path=WindowStyle.Height}" 
        Width="{Binding Path=WindowStyle.Height}"
        Icon="{Binding Path=WindowStyle.Icon}"
        Title="{Binding Path=Title}"
        FontFamily="{Binding Path=WindowStyle.FontFamily}"
        FontSize="{Binding Path=WindowStyle.FontSize}">
    <DockPanel Background="{Binding Path=WindowStyle.Background}">
        <!-- Status bar -->
        <Border DockPanel.Dock="Bottom" 
                Margin="{Binding Path=WindowStyle.StatusBar.Margin}"
                Visibility="{Binding Path=StatusBarVisibility}"
                BorderBrush="{Binding Path=WindowStyle.StatusBar.BorderBrush}"
                CornerRadius="{Binding Path=WindowStyle.StatusBar.CornerRadius}" 
                Background="{Binding Path=WindowStyle.StatusBar.ContentBackground}">
            <DockPanel Background="Transparent">
                <!-- Status bar dei plugin -->
                <StatusBar DockPanel.Dock="Right"
                           Background="Transparent"
                           VerticalContentAlignment="Center"
                           Foreground="{Binding Path=WindowStyle.StatusBar.ContentForeground}"
                           Height="{Binding Path=WindowStyle.StatusBar.Height}"
                           FontSize="{Binding Path=WindowStyle.StatusBar.FontSize}"
                           FontFamily="{Binding Path=WindowStyle.StatusBar.FontFamily}"
                           ItemsSource="{Binding Path=PluginsStatusBarElements}">
                </StatusBar>
                <!-- messaggio (sempre visibile) -->
                <StatusBar Background="Transparent"
                           VerticalContentAlignment="Center"
                           Foreground="{Binding Path=WindowStyle.StatusBar.ContentForeground}"
                           Height="{Binding Path=WindowStyle.StatusBar.Height}"
                           FontSize="{Binding Path=WindowStyle.StatusBar.FontSize}"
                           FontFamily="{Binding Path=WindowStyle.StatusBar.FontFamily}" >
                    <StatusBarItem>
                        <TextBlock Text="{Binding Path=StatusBarMessage}" />
                    </StatusBarItem>
                </StatusBar>
            </DockPanel>
        </Border>
        <!-- Web browser -->
        <Custom:WebControl x:Name="webControl"
                           Source="{Binding Path=Source}"
                           TitleChanged="WebControl_TitleChanged"
                           LoadingFrame="WebControl_LoadingFrame"
                           LoadingFrameComplete="WebControl_LoadingFrameComplete"
                           LoadingFrameFailed="WebControl_LoadingFrameFailed"/>
    </DockPanel>
</Window>
